package modele;

public class Player {

	protected String name;
	public Cell current_cell;

	public Player(String n, Cell c) {
		this.name = n;
		current_cell = c;
		c.setPlayer(this);
	}

	/**
	 * Moves the player to the given <code>Cell</code>
	 * @param c the Cell
	 */
	public void moveTo(Cell c) {
		// Empty the old cell
		current_cell.setPlayer(null);
		// Change current cell to new one
		current_cell = c;
		// Give the cell its new occupying player
		c.setPlayer(this);
	}

	/**
	 * Gives the <code>Cell</code> on which the player is.
	 * @return current cell of the player
	 */
	public Cell getCurentCell() {
		return current_cell;
	}

	public String toString() {
		return name;
	}

}
